/** @file Error reporting features
 * This is not to be confused with the testing framework */
#pragma once

#include "util.hpp"
#include "core/log.hpp"

extern void init_error();
extern void exit_error();

/** Report an error
 * @param m error message to report */
extern void error(const std::string& m);

/** Report a warning
 * @param m warning message to report */
extern void warning(const std::string& m);

/** Report information
 * @param m info message to report */
extern void info(const std::string& m);

extern void onTestFail();

#ifdef assert
#undef assert
#endif
/** Preform an assertion
 * @param c condition to test
 * @param m message to display */
#define assert(c) if(!(c)) {error("Assertion "#c" failed!");}

/** Preform a non fatal assertion
 * @param c condition to test
 * @param m message to display */
#define assertWarning(c,m) if(!(c)) warning(m);
